package com.web;

import com.pojo.dto.Message;
import com.pojo.vo.CTicketRoundVo;
import com.pojo.vo.CTicketVo;
import com.service.CTicketRoundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CTicketRoundController {
    @Autowired
    CTicketRoundService cTicketRoundService;

    @RequestMapping(value = "/cticketrounds", method = RequestMethod.POST)
    public Message<List<CTicketRoundVo>> findList(CTicketRoundVo cTicketRoundVo) {
        return cTicketRoundService.list(cTicketRoundVo);
    }

    @RequestMapping(value = "/cticketrounds/selectone", method = RequestMethod.POST)
    public Message<CTicketRoundVo> find(Long planId) {
        return cTicketRoundService.selectOne(planId);
    }

    @RequestMapping(value = "/cticketrounds/add", method = RequestMethod.POST)
    public Message<CTicketRoundVo> add(CTicketRoundVo cTicketRoundVo) {
        return cTicketRoundService.add(cTicketRoundVo);
    }

    @RequestMapping(value = "/cticketrounds/update", method = RequestMethod.POST)
    public Message<CTicketRoundVo> update(CTicketRoundVo cTicketRoundVo) {
        return cTicketRoundService.update(cTicketRoundVo);
    }

    @RequestMapping(value = "/cticketrounds/delete/{planId}", method = RequestMethod.POST)
    public Message<CTicketRoundVo> delete(@PathVariable Long planId) {
        return cTicketRoundService.delete(planId);
    }

    @RequestMapping(value = "/cticketrounds/ticket", method = RequestMethod.POST)
    public Message<List<CTicketVo>> designTicket(CTicketRoundVo cTicketRoundVo) {
        return cTicketRoundService.designTicket(cTicketRoundVo);
    }

}
